/*
 * User.cpp
 *
 *  Created on: Aug 3, 2011
 *      Author: sebastien
 */

#include "User.h"

User::User(xn::UserGenerator userGenerator, XnUserID user, BulletConfiguration *bulletConfiguration) {
//	this->skeleton = new CharacterSkeleton(userGenerator, user, *bulletConfiguration);
	this->selection = 0;
	this->action = ACTION_NONE;
	this->id = user;
	this->userGenerator = userGenerator;
}

User::~User() {
	delete skeleton;
}

UserAction User::getAction() const
{
    return action;
}

btCollisionObject *User::getSelection() const
{
    return selection;
}

CharacterSkeleton *User::getSkeleton() const
{
    return skeleton;
}

void User::setAction(UserAction action)
{
    this->action = action;
}

void User::setSelection(btCollisionObject *selection)
{
    this->selection = selection;
}

void User::unselect()
{
	this->selection = 0;
}

void User::updateSkeleton()
{
	this->skeleton->update(this->userGenerator, this->id);
}

